import java.util.TreeSet;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-07-07
 * Time: 17:41
 */
public class Test {
    public static void main(String[] args) {
        TreeSet<Student> ts = new TreeSet<>();//可排序（默认从小到大）、不重复、无索引

        Student s1 = new Student("zhangsan",18);
        Student s2 = new Student("lisi",20);
        Student s3 = new Student("wangwu",16);

        ts.add(s1);
        ts.add(s2);
        ts.add(s3);

        System.out.println(ts);
    }
}
